<script setup lang="ts">
import { PropType, ref, watch } from 'vue'
import { Qrcode } from '@/components/Qrcode'
import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
import { ContentWrap } from '@/components/ContentWrap'
import { ElRow, ElCard, ElCol, ElMessage } from 'element-plus'
const props = defineProps({
  currentRow: {
    type: Object,
    default: () => undefined
  },
  detailSchema: {
    type: Array as PropType<DescriptionsSchema[]>,
    default: () => []
  }
})
interface user {
  UserName: string
  UserNo: string
}
const chooes = ref<user[]>([])
watch(
  () => props.currentRow,
  (currentRow) => {
    if (!currentRow) return
    currentRow.chooes.map((item) => {
      let a = item.split('$')
      chooes.value.push({ UserName: a[1], UserNo: a[0] })
    })
    // chooes.value = currentRow.chooes
  },
  {
    deep: true,
    immediate: true
  }
)
</script>

<template>
  <Descriptions :schema="detailSchema" :data="currentRow || {}" :column="1" />
</template>
